import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);
import Layout from "@/views/layout.vue";
import Article from "@/views/article.vue";
import Like from "@/views/like.vue";
import Collect from "@/views/collect.vue";
import User from "@/views/user.vue";
import ArticleDetail from "@/views/article-detail.vue";
const router = new VueRouter({
  routes: [
    {
      path: "/",
      component: Layout,
      redirect: "/article",
      children: [
        { path: "article", component: Article },
        { path: "like", component: Like },
        { path: "collect", component: Collect },
        { path: "user", component: User },
      ],
    },
    {
      path: "/article-detail/:id",
      component: ArticleDetail,
    },
  ],
});

export default router;

// 1. 装包版本有问题
// 2. 下包下失败
